﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ControlStock.Dominio;
using ControlStock.Servicio;

namespace ControlStock
{
    public partial class Articuloconsulta : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["id_Usuario"] == null)
                Response.Redirect("index.aspx");

        }

        protected void btn_busqueda_Click(object sender, EventArgs e)
        {
            ArticuloServicio busqueda = new ArticuloServicio();
            gvwarticulos.DataSource = busqueda.Listar(txt_busqueda.Text,Convert.ToString(Session["Tipo_Usuario"]));
            gvwarticulos.DataBind();
        }

        protected void gvwarticulos_RowEditing(object sender, GridViewEditEventArgs e)
        {
            Response.Redirect("Articulomodificacion.aspx?id=" + gvwarticulos.Rows[e.NewEditIndex].Cells[1].Text);
        }
    }
}
